import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import '../src/assets/css/global.css'
import http from './http/index'
// 導入餓了麼按需引入的組件

// import './plugins/element' // 已经CND
//導入字體圖標
import '../src/assets/fonts/iconfont.css'
import VueQuillEditor from 'vue-quill-editor'
import VeLine from 'v-charts/lib/line.common'
Vue.component(VeLine.name, VeLine)
Vue.use(VueQuillEditor)
// 全局掛在axios請求
Vue.prototype.$http = http

Vue.config.productionTip = false


// 注册全局过滤器 处理时间
Vue.filter('dateFormat', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  // padStart (总长度，不满足希望填充的值)
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})




new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
